﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
using YiYiTong.Rocket.EFDBFirst;
using YiYiTong.Rocket.Entity;
using YiYiTong.Rocket.Model.ParamModel;

namespace YiYiTong.Rocket.Model
{
    /// <summary>
    /// 添加商品临时导入信息
    /// </summary>
    public class AddPushMsgModel : BaseParamModel
    {
        /// <summary>
        /// 发送的人 123,1223,123234,34534,
        /// </summary>
        public string ReceiveUids { get; set; }
        //临时对象
        public ADZ_Pushmessage aDZ_Pushmessage { get; set; } = new ADZ_Pushmessage();

        public Tuple<bool, string> CheckAdd()
        {

            StringBuilder strResult = new StringBuilder();
            if (aDZ_Pushmessage.ReceiveType == 1)
            {
                if (string.IsNullOrWhiteSpace(ReceiveUids))
                {
                    strResult.Append("请设置接收消息的人");
                }
            }
            if (string.IsNullOrWhiteSpace(aDZ_Pushmessage.MsgText))
                strResult.Append("消息内容不能为空，");
            bool ret = strResult.Length == 0;
            if (!ret)
                strResult.Remove(strResult.Length - 1, 1);
            return new Tuple<bool, string>(ret, strResult.ToString());
        }
    }
}